-- GENERATED SPELL FOR [Dark Rune Evoker] --


function spell0_32878(pUnit, Event) --@Runic Lightning,n/a--
pUnit:FullCastSpellOnTarget(62327,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32878', 1500, 1)
end

function spell1_32878(pUnit, Event) --@Runic Lightning,n/a--
pUnit:FullCastSpellOnTarget(62445,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32878', 1500, 1)
end

function spell2_32878(pUnit, Event) --@Runic Mending,n/a--
pUnit:FullCastSpellOnTarget(62328,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32878', 17000, 1)
end

function spell3_32878(pUnit, Event) --@Runic Mending,n/a--
pUnit:FullCastSpellOnTarget(62446,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32878', 17000, 1)
end

function spell4_32878(pUnit, Event) --@Runic Shield,n/a--
pUnit:FullCastSpellOnTarget(62321,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32878', 500, 1)
end

function spell5_32878(pUnit, Event) --@Runic Shield,n/a--
pUnit:FullCastSpellOnTarget(62529,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_32878', 500, 1)
end

function Sorts_32878(pUnit, Event)
local choix_sorts_32878 = math.random(0, 5)
if choix_sorts_32878 == 0 then
pUnit:RegisterEvent('spell0_32878', 1, 1)
end
if choix_sorts_32878 == 1 then
pUnit:RegisterEvent('spell1_32878', 1, 1)
end
if choix_sorts_32878 == 2 then
pUnit:RegisterEvent('spell2_32878', 1, 1)
end
if choix_sorts_32878 == 3 then
pUnit:RegisterEvent('spell3_32878', 1, 1)
end
if choix_sorts_32878 == 4 then
pUnit:RegisterEvent('spell4_32878', 1, 1)
end
if choix_sorts_32878 == 5 then
pUnit:RegisterEvent('spell5_32878', 1, 1)
end
end

function mob32878_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_32878', math.random(1500, 3000), 1)
end

function mob32878_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32878_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob32878_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(32878, 1, 'mob32878_Action')
RegisterUnitEvent(32878, 2, 'mob32878_Leave')
RegisterUnitEvent(32878, 3, 'mob32878_Kill')
RegisterUnitEvent(32878, 4, 'mob32878_Die')
